package com.lsyonlygoddes.task;

import com.lsyonlygoddes.websocket.WebsocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author:lsyonlygoddes
 * @time:2024/1/18 13:06
 */
@Component
public class WebsocketTask {

    @Autowired
    private WebsocketServer server;

    @Scheduled(cron = "0/5 * * * * *")
    public void sendMsg() throws Exception {
        server.sendMsg();
    }
}
